CREATE TABLE [agency].[CurrencyBatchDetail]
(
[CurrencyBatchDetailId] [bigint] NOT NULL IDENTITY(1, 1),
[CurrenyBatchId] [bigint] NULL,
[CurrencyId] [int] NULL,
[BaseCurrencyId] [int] NULL,
[Rate] [decimal] (18, 4) NULL,
[Active] [bit] NOT NULL,
[Deleted] [bit] NOT NULL,
[CreatedBy] [int] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [int] NULL,
[ModifiedOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [agency].[CurrencyBatchDetail] ADD CONSTRAINT [PK_CurrencyBatchDetail] PRIMARY KEY CLUSTERED  ([CurrencyBatchDetailId]) ON [PRIMARY]
GO
ALTER TABLE [agency].[CurrencyBatchDetail] ADD CONSTRAINT [FK_CurrencyBatchDetail_Currency1] FOREIGN KEY ([BaseCurrencyId]) REFERENCES [agency].[Currency] ([CurrencyId])
GO
ALTER TABLE [agency].[CurrencyBatchDetail] ADD CONSTRAINT [FK_CurrencyBatchDetail_Currency] FOREIGN KEY ([CurrencyId]) REFERENCES [agency].[Currency] ([CurrencyId])
GO
ALTER TABLE [agency].[CurrencyBatchDetail] ADD CONSTRAINT [FK_CurrencyBatchDetail_CurrenyBatch] FOREIGN KEY ([CurrenyBatchId]) REFERENCES [agency].[CurrenyBatch] ([CurrenyBatchId])
GO
